<?php
include_once BONE_ROOT.DS.'uis'.DS.'tinymce'.DS.'tinymce.php';

class admin_ui_tinymce extends ui_tinymce
{

    public function display()
    {
        if(!defined('tinymce_loaded'))
        {
            define('tinymce_loaded', 1);
            ?>
<script type="text/javascript" src="<?php echo BONE_URL; ?>/uis/tinymce/jquery.tinymce.js"></script>
<script type="text/javascript">
	$().ready(function() {
		$('textarea.tinymce_editor').tinymce({
			script_url : '<?php echo BONE_URL; ?>/uis/tinymce/tiny_mce.js',
			language : "zh",
			theme : "advanced",
			
			force_p_newlines : false, 
			force_br_newlines : true, 
			remove_linebreaks : false,
			button_tile_map : true,

			plugins : "inlinepopups,media,paste,fullscreen,boneimage",
			
			theme_advanced_buttons1 : "undo,redo,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,|,hr,link,unlink,image,boneimage,media,charmap,|,removeformat,code,fullscreen",
			theme_advanced_buttons3 : "",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_path : false,
			theme_advanced_resizing : true,
			theme_advanced_resizing_use_cookie : false,
			theme_advanced_fonts : "黑体=黑体;楷体=楷体;仿宋=仿宋;隶书=隶书;幼圆=幼圆;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",

			font_size_style_values : "8px,10px,12px,14px,18px,24px,36px"
		});
	});
</script>
            <?php
        }
        
        echo '<textarea name="' . $this->name . '" id="' . $this->name . '" class="tinymce_editor" style="width:' . $this->width . ';height:' . $this->height . ';">' . htmlspecialchars($this->value) . '</textarea>';
    }



}
?>